package com.jianjunhuang.demo.wechatdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class WelcomeActivity extends AppCompatActivity implements View.OnClickListener {

    private Button loginBtn;
    private Button signUpBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.welcome_activity);

        loginBtn = findViewById(R.id.welcome_login_btn);
        signUpBtn = findViewById(R.id.welcome_sign_up_btn);

        loginBtn.setOnClickListener(this);
        signUpBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        switch (v.getId()) {
            case R.id.welcome_login_btn: {
                intent.setClass(WelcomeActivity.this, LoginActivity.class);
                break;
            }
            case R.id.welcome_sign_up_btn: {
                intent.setClass(WelcomeActivity.this, SignInActivity.class);
                break;
            }
        }
        startActivity(intent);
    }
}
